package com.mentaleye.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mentaleye.dal.dao.DeptRelationDao;
import com.mentaleye.dal.model.DeptRelation;
import com.mentaleye.dal.model.DeptRelationExample;
import com.mentaleye.dal.model.DeptRelationKey;
import com.mentaleye.dal.service.DeptRelationMapper;

@Component
public class DeptRelationDaoImpl extends BaseDao implements DeptRelationDao{

	@Autowired private DeptRelationMapper deptRelationMapper;
	
	@Override
	public boolean insertDeptRelation(DeptRelation deptRelation){
		return getResultByInt(deptRelationMapper.insertSelective(deptRelation));
	}
	
	@Override
	public boolean deleteDeptRelation(DeptRelationKey key){
		return getResultByInt(deptRelationMapper.deleteByPrimaryKey(key));
	}
	
	@Override
	public boolean deleteDeptRelation(Map<String, Object> map){
		return getResultByInt(deptRelationMapper.deleteDeptRelationList(map));
	}
	
	@Override
	public DeptRelation selectDeptRelationOne(DeptRelationKey key){
		return deptRelationMapper.selectByPrimaryKey(key);
	}
	
	@Override
	public List<DeptRelation> selectDeptRelationList(DeptRelationExample example){
		return deptRelationMapper.selectByExample(example);
	}
	
	@Override
	public boolean insertDeptRelationList(List<DeptRelation> list){
		return getResultByInt(deptRelationMapper.insertDeptRelationList(list));
	}
}
